<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>03_音频案例</title>
    <style>
      .mask {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: rgba(0, 0, 0, 0.7);
      }
      .dialog {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 400px;
        height: 400px;
        margin: auto;
        line-height: 400px;
        background-color: green;
        text-align: center;
        span {
          font-size: 40px;
          cursor: pointer;
          border: 1px solid white;
          color: white;
        }
      }
    </style>
  </head>

  <body>
    <audio src="./小曲.mp3" id="music" controls></audio>
    <div class="mask" id="mask">
      <div class="dialog">
        <span>点我登录</span>
        <span onclick="go()">随便听听</span>
      </div>
    </div>

    <script>
      function go() {
        music.play()
        mask.style.display = 'none'
      }
    </script>
  </body>
</html>
